Imports Spring.Context
Imports Spring.Context.Support

<Serializable()> _
Public Class BaseDominio
    Implements IRepositorio

    Private _id As Nullable(Of Long)
    Public Overridable Property Id() As Nullable(Of Long)
        Get
            Return _id
        End Get
        Set(ByVal value As Nullable(Of Long))
            _id = value
        End Set
    End Property

    Private _repositorio As IRepositorio
    Protected Overridable Property Repositorio() As IRepositorio
        Get
            Return _repositorio
        End Get
        Set(ByVal value As IRepositorio)
            _repositorio = value
        End Set
    End Property

    Public Sub New()
        'Console.WriteLine("Injecting")
        Dim _contextoDoSpring As IApplicationContext = ContextRegistry.GetContext()
        Dim _repositorio As IRepositorio

        _repositorio = DirectCast(_contextoDoSpring("ArtNoi.Repositorio"), IRepositorio)
        Me.Repositorio = _repositorio

    End Sub

#Region "Classes Injetadas"

    Protected Overridable Property VendaDao() As IVendaDao Implements IRepositorio.VendaDao
        Get
            Return Me.Repositorio.VendaDao
        End Get
        Set(ByVal value As IVendaDao)

        End Set
    End Property

    Protected Overridable Property ProdutoDao() As IProdutoDao Implements IRepositorio.ProdutoDao
        Get
            Return Me.Repositorio.ProdutoDao
        End Get
        Set(ByVal value As IProdutoDao)

        End Set
    End Property

    Protected Overridable Property ContratoDao() As IContratoDao Implements IRepositorio.ContratoDao
        Get
            Return Me.Repositorio.ContratoDao
        End Get
        Set(ByVal value As IContratoDao)

        End Set
    End Property

    Protected Overridable Property ClienteDao() As IClienteDao Implements IRepositorio.ClienteDao
        Get
            Return Me.Repositorio.ClienteDao
        End Get
        Set(ByVal value As IClienteDao)

        End Set
    End Property

    Protected Overridable Property VestuarioDao() As IVestuarioDao Implements IRepositorio.VestuarioDao
        Get
            Return Me.Repositorio.VestuarioDao
        End Get
        Set(ByVal value As IVestuarioDao)

        End Set
    End Property

    Protected Overridable Property LojaDao() As ILojaDao Implements IRepositorio.LojaDao
        Get
            Return Me.Repositorio.LojaDao
        End Get
        Set(ByVal value As ILojaDao)

        End Set
    End Property

    Protected Overridable Property EnderecoDao() As IEnderecoDao Implements IRepositorio.EnderecoDao
        Get
            Return Me.Repositorio.EnderecoDao
        End Get
        Set(ByVal value As IEnderecoDao)

        End Set
    End Property

    Protected Overridable Property TipoVestuarioDao() As ITipoVestuarioDao Implements IRepositorio.TipoVestuarioDao
        Get
            Return Me.Repositorio.TipoVestuarioDao
        End Get
        Set(ByVal value As ITipoVestuarioDao)

        End Set
    End Property

    Protected Overridable Property FuncionarioDao() As IFuncionarioDao Implements IRepositorio.FuncionarioDao
        Get
            Return Me.Repositorio.FuncionarioDao
        End Get
        Set(ByVal value As IFuncionarioDao)

        End Set
    End Property

    Protected Overridable Property TelefoneDao() As ITelefoneDao Implements IRepositorio.TelefoneDao
        Get
            Return Me.Repositorio.TelefoneDao
        End Get
        Set(ByVal value As ITelefoneDao)

        End Set
    End Property

    Protected Overridable Property EmailDao() As IEmailDao Implements IRepositorio.EmailDao
        Get
            Return Me.Repositorio.EmailDao
        End Get
        Set(ByVal value As IEmailDao)

        End Set
    End Property

    Protected Overridable Property RedeSocialDao() As IRedeSocialDao Implements IRepositorio.RedeSocialDao
        Get
            Return Me.Repositorio.RedeSocialDao
        End Get
        Set(ByVal value As IRedeSocialDao)

        End Set
    End Property

    Protected Overridable Property ContatoDao() As IContatoDao Implements IRepositorio.ContatoDao
        Get
            Return Me.Repositorio.ContatoDao
        End Get
        Set(ByVal value As IContatoDao)

        End Set
    End Property

    Protected Overridable Property ErrorLogDao() As IErrorLogDao Implements IRepositorio.ErrorLogDao
        Get
            Return Me.Repositorio.ErrorLogDao
        End Get
        Set(ByVal value As IErrorLogDao)

        End Set
    End Property

#End Region

End Class
